{% extends 'starter.html' %}

{% block title %}
    <h1>
{#        {% if tag  == 1 %}#}
{#            客户展示#}
{#            <small>Optional description</small>#}
{#            {% else %}#}
{#            我的客户#}
{#            <small>Optional description</small>#}
{#        {% endif %}#}
{#    {% load mytags %}#}
{#    {% tag request %}#}
    跟进记录展示
    </h1>
{% endblock %}


{% block content %}
    <a href="" class="btn btn-primary">添加跟进记录</a>
    <div class="form-group">
    <form class="form-inline" action="{{ current_request_path }}">
        <div class="form-group pull-right">
            <select name="search_field" id="search_field" class="form-control">
                <option value="customer__name__contains" {% if search_field == 'customer__name__contains' %} selected {% endif %}>客户姓名</option>
            </select>
            <label for="key_word"></label>
            <input type="text" class="form-control" id="key_word" placeholder="请输入搜素内容" name="kw" value="{{ kw }}">
        <button type="submit" class="btn btn-default">搜索</button>
        </div>
    </form>
    <form class="form-inline"  action="" method="post">
        <select name="action" id="action" class="form-control">

         <option value="bulk_delete">批量删除</option>
        </select>
        <button class="btn btn-warning">go</button>

    <table class="table table-striped table-hover table-bordered">
        <thead>
        <tr>
            <th>
                <input type="checkbox" id="select_all">操作
            </th>
            <th>序号</th>
            <th>所资讯客户</th>
            <th>跟进内容</th>
            <th>跟进状态</th>
            <th>跟进人</th>
            <th>跟进日期</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {% for consult in consult_list %}
            <tr>
                <td>
                    <input type="checkbox" name="cids" value="{{ consult.pk }}">
                </td>
                <td>{{ forloop.counter }}</td>
                <td>{{ consult.customer }}</td>
                <td>{{ consult.note }}</td>
                <td>{{ consult.get_status_display }}</td>
                <td>{{ consult.consultant }}</td>
                <td>{{ consult.date|date:'Y-m-d' }}</td>
                <td>
                    <a href=""><i class="fa fa-edit"></i></a>
                    <a href=""><i class="fa fa-remove"></i></a>
                </td>
            </tr>
        {% endfor %}

        </tbody>
    </table>
    {{ page_html | safe }}
    </form>
    </div>

    {#    <nav aria-label="Page navigation">#}
    {#        <ul class="pagination">#}
    {#            <li>#}
    {#                <a href="#" aria-label="Previous">#}
    {#                    <span aria-hidden="true">&laquo;</span>#}
    {#                </a>#}
    {#            </li>#}
    {#            {% for p in page_num_count %}#}
    {#                <li><a href="/customers/?page={{ p }}">{{ p }}</a></li>#}
    {#            {% endfor %}#}
    {##}
    {##}
    {#            <li>#}
    {#                <a href="#" aria-label="Next">#}
    {#                    <span aria-hidden="true">&raquo;</span>#}
    {#                </a>#}
    {#            </li>#}
    {#        </ul>#}
    {#    </nav>#}


{% endblock content %}